# -*- mode: snippet -*-
# name: savexls using XLConnect
# key: savexls@XLConnect
# contributor : Shuguang Sun
# --
## Load workbook (create if not existing)
wb <- XLConnect::loadWorkbook(filename = "./file.xlsx", create = TRUE)
## Create a worksheet
XLConnect::createSheet(object = wb, name = "sheet1")
## offset from the top left corner and with default header = TRUE
XLConnect::writeWorksheet(object = wb, data = CO2, sheet = "sheet1", startRow = 4, startCol = 2)
## Save workbook (this actually writes the file to disk)
XLConnect::saveWorkbook(wb)
